from jsonpath import jsonpath

data = {'key1':{'key2':{'key3':{'key4':{'key5':{'key6':{'key7':{'key8':{'key9':'python'}}}}}}}}}
# 传统打印
print(data['key1']['key2']['key3']['key4']['key5']['key6']['key7']['key8']['key9'])
# jsonpath的结果为列表，获取数据需要索引
# 绝对路径：
print(jsonpath(data, '$.key1.key2.key3.key4.key5.key6.key7.key8.key9')[0])
# 相对路径：
print(jsonpath(data, '$..key9')[0])